<?php 
    namespace Application\Form;
    
    use Zend\Form\Form;
    class AlbumForm extends Form{
        public function __construct($name = null){
            parent::__construct('album');
            $this->setAttribute('method', 'post');
            $this->setAttribute('enctype','multipart/form-data');
            $this->add(array(
                'name' => 'id',
                'attributes' => array(
                    'type'  => 'hidden',
                ),
                'options' => array(
                    'id'  => 'id',
                    'label'  => "No",
                ),
                'validators' => array(
                ),
            ));
            $this->add(array(
                'name' => 'name',
                'attributes' => array(
                    'type'  => 'text',
                ),
                'options' => array(
                    'id'  => 'name',
                    'label'  => "Name",
                ),
                'filters' => array(
                    array(
                        'name' => 'StringTrim'
                    )
                ),
                'validators' => array(
                    array(
                        'name' => 'NotEmpty',
                        'options' => array(
                            'messages' => array(\Zend\Validator\NotEmpty::IS_EMPTY =>'Name is require')
                        )
                    )
                ),
            ));
            $this->add(array(
                'name' => 'path',
                'attributes' => array(
                    'type'  => 'file',
                ),
                'options' => array(
                    'id'  => 'path',
                    'label'  => "Path",
                ),
                'validators' => array(
                ),
            ));
            $this->add(array(
                'name' => 'description',
                'attributes' => array(
                    'type'  => 'textarea',
                ),
                'options' => array(
                    'id'  => 'description',
                    'label'  => "Description",
                ),
                'filters' => array(
                    array(
                        'name' => 'StringTrim'
                    )
                ),
                'validators' => array(
                ),
            ));
            $this->add(array(
                'name' => 'native',
                'attributes' => array(
                    'type'  => 'date',
                ),
                'options' => array(
                    'id'  => 'native',
                    'label'  => "native",
                ),
                'filters' => array(
                    array(
                        'name' => 'StringTrim'
                    )
                ),
                'validators' => array(
                ),
            ));
            $this->add(array(
                'name' => 'type',
                'attributes' => array(
                    'type'  => 'number',
                ),
                'options' => array(
                    'id'  => 'type',
                    'label'  => "type",
                ),
                'filters' => array(
                    array(
                        'name' => 'StringTrim'
                    )
                ),
                'validators' => array(
                ),
            ));
            $this->add(array(
                'name' => 'submit',
                'attributes' => array(
                    'type'  => 'submit',
                    'value' => 'Submit',
                    'id' => 'submitbutton',
                ),
            ));
        }
    }
